//
//  ConfigurationDialog.h
//  trowel
//
//  Created by Jonathan Reams on 1/12/10.
//  Copyright 2010 ReamsTronics. All rights reserved.
//

#import <OAuthConsumer/OAMutableURLRequest.h>
#import <Cocoa/Cocoa.h>

@interface Configuration : NSObject <NSTableViewDataSource> {
	IBOutlet NSTableView * accountList;
	IBOutlet NSTextField * countPerUpdateField;
	IBOutlet NSComboBox * intervalField, * clickActionField, *stopAfterField;
	IBOutlet NSTextField * usernameField, * testStatusLabel, * pinField;
	IBOutlet NSProgressIndicator * testIndicator;
	IBOutlet NSButton * authorizeButton;
	IBOutlet NSButton * useSSLField, * isUserDefault;
	IBOutlet NSButton * stickyTweetsButton, * showProfilePicsButton, * importantTweetsButton, *stickyMentionsButton;
	IBOutlet NSWindow * configurationPanel, *accountAddPanel, *authorizeWindow;
	IBOutlet id authPageView;
	NSDictionary * defaultAccountData;
	NSMutableDictionary * accounts;
	NSMutableDictionary * volatileAccounts;
	NSArray * storedAccountInfo;
	NSMutableDictionary * passwordStore;
	NSUserDefaults * savedConfig;
	NSLock * theLock;
	OAConsumer * theConsumer;
	OAToken * lastRequestToken;
	id myTc;
}

- (id) initWithTwitterClient: (id) tc;
- (IBAction) addOrRemoveAccount: (id)sender;
- (IBAction) preferencesFinished: (id)sender;
- (IBAction) testAccountAdd: (id)sender;
- (IBAction) saveNewAccount: (id)sender;
- (IBAction) editAccount: (id) sender;
- (IBAction) authorizeAccount: (id) sender;
- (IBAction) doPreferencesGUI: (id) sender;
- (IBAction) doAuthorizeContinue: (id) sender;
- (NSArray*) getUsers;
- (id) getGlobalSetting: (NSString *) key;
- (id) getUserSetting: (NSString *) key forUser: (NSString*) username;
- (void) setUserSetting: (id) value forKey: (NSString*) key forUser: (NSString*) username;
- (void) syncronizeAccounts;
- (NSString*) stringWithURL: (NSURL*) url forUser: (NSString*) username error: (NSError**) error forMethod: (NSString*) methodName;
- (NSString*) stringWithURL: (NSURL*) url forUser: (NSString*) username error: (NSError**) error;
@end
